﻿using Helper;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace TestApp
{
    class Program
    {
        static void Main(string[] args)
        {


            string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\MCA\\";
            if (!System.IO.File.Exists(path))
            {

                if (!Directory.Exists(path))

                    Directory.CreateDirectory(path);

                using (File.Create(path + "denemeMCAResponse.xml")) { }
            }
            using (StreamWriter writer = new StreamWriter(path + "denemeMCAResponse.xml"))
            {
                writer.Write("fatih");
            }

            //  TFSHelper t = new TFSHelper();
            //Console.WriteLine(t.GetHashCode().ToString());
            //TFSHelper t1 = new TFSHelper();
            //Console.WriteLine(t1.GetHashCode().ToString());
            //Console.WriteLine(t1.GetHashCode().ToString());

            //string d1 = string.Empty;
            //object o1 = null;
            //int i1 = 0;
            //decimal d = decimal.Zero;

            //Console.WriteLine(d1.GetHashCode());
            ////Console.WriteLine(o1.GetHashCode());
            //Console.WriteLine(i1.GetHashCode());
            //Console.WriteLine(d.GetHashCode());

            //string d = "deneme";

            //Console.WriteLine(d);

            //GCHandle handle = GCHandle.Alloc(d, GCHandleType.Normal);

            //IntPtr point = GCHandle.ToIntPtr(handle);

            //Console.WriteLine(point.ToString());

            //Test(ref d);
            //Console.WriteLine(d);

            //Class1 c = new Class1();

            //c.Go();

            //Dude Bill = new Dude();
            //Bill.Name = "Bill";
            //Bill.LeftShoe = new Shoe();
            //Bill.RightShoe = new Shoe();
            //Bill.LeftShoe.Color = Bill.RightShoe.Color = "Blue";

            //Dude Ted = Bill.Clone() as Dude;
            //Ted.Name = "Ted";
            //Ted.LeftShoe.Color = Ted.RightShoe.Color = "Red";

            //Console.WriteLine(Bill.ToString());
            //Console.WriteLine(Ted.ToString());
            Console.ReadLine();

        }

        static void Test(ref string test)
        {
            GCHandle handle = GCHandle.Alloc(test, GCHandleType.Normal);

            IntPtr point = GCHandle.ToIntPtr(handle);
            test = "sert";
        }
    }
    class Class1
    {
        public void Go()
        {
            int x = 5;
            AddFive(x);

            Console.WriteLine(x.ToString());

        }

        public int AddFive(int pValue)
        {
            pValue += 5;
            return pValue;
        }
    }

    public class Shoe
    {
        public string Color;
    }

    public class Dude : ICloneable
    {
        public string Name;
        public Shoe RightShoe;
        public Shoe LeftShoe;


        public override string ToString()
        {
            return (Name + " : Dude!, I have a " + RightShoe.Color +
                " shoe on my right foot, and a " +
                 LeftShoe.Color + " on my left foot.");
        }


        public object Clone()
        {
            Dude newPerson = new Dude();
            newPerson.Name = Name;
            newPerson.LeftShoe = LeftShoe;
            newPerson.RightShoe = RightShoe;

            return newPerson;

        }
    }
}
